package duijiangji;

import com.unicom.office.dataitem.NumberDataItem;
import com.unicom.office.dataitem.StringDataItem;
import com.unicom.office.runtime.OfficeRuntime;
import com.unicom.office.templatefunc.TemplateFunc;
import com.unicom.office.type.NumberTypeItem;
import com.unicom.office.type.StringTypeItem;
import com.unicom.office.type.TypeItem;
import com.unicom.office.unit.OfficeUnit;

import java.text.DecimalFormat;
import java.util.List;
import java.util.Map;

public class WanFunc extends TemplateFunc {
    public Object run(List<Object> params, OfficeRuntime officeRuntime) {
        NumberDataItem num = (NumberDataItem) params.get(0);
        double a = num.getDoubleValue() / 1000d;
        double round = Math.ceil(a);
        return NumberDataItem.create(round / 10d);
    }

    public void runForMatch(OfficeUnit unit, List<Object> params, OfficeRuntime officeRuntime) {

    }

    public String getName() {
        return "wan";
    }

    public TypeItem getType() {
        return NumberTypeItem.INSTANCE;
    }
}
